<?php

class Enumeration
{
	private $array = array();
	public function __construct($databasetocopy,$tablename)
	{
		$database = $databasetocopy->Recopy();
		$table = new DBTable($database,$tablename);
		$tableStructure = $table->getTableStructure();
		$keys = array_keys($tableStructure);

		$sql = "SELECT ";

		foreach($keys as $key)
		{
			$sql .= $key.", ";#
		}

		$sql = substr($sql,0,-2)." ";

		$sql .= "FROM ".$tablename." ORDER BY ".$keys[1];
//		echo $sql;
		$database->ExecuteSQL($sql);

		while($row=$database->getRow())
		{
			$this->array[$row[$keys[0]]] = $row[$keys[1]];
		}

	}
	public function getArray()
	{
		return $this->array;
	}



}

?>
